import request from '@/utils/request/request';
import { DataSourceReqRecord } from './model/dataSourceConfigModel';

// 查询数据源配置列表
export function queryDataSourceRecord() {
  return request.get('/api/infra/data-source-config/list');
}

// 保存数据源配置
export function saveDataSourceRecord(data: DataSourceReqRecord) {
  return request.post('/api/infra/data-source-config', {
    ...data,
  });
}

// 更新数据源配置
export function updateDataSourceRecord(data: DataSourceReqRecord) {
  return request.put('/api/infra/data-source-config', {
    ...data,
  });
}

// 删除数据源配置
export function removeDataSourceRecord(id: string) {
  return request.delete('/api/infra/data-source-config', {
    params: { id },
  });
}
